/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* E.P. Scene Graph
* Developed by:
*       - Eduardo Ribeiro (eribeiro @ tecgraf . puc-rio . br)
*       - Peter Dam (peter @ tecgraf . puc-rio . br)
* File: Camera.h
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef _EPSG_CAMERA_
#define _EPSG_CAMERA_

#include "EPSG/Leaf.h"
#include "EPSG/Vec3.h"
#include "EPSG/Prototypes.h"

namespace EPSG
{
	class Camera : public Leaf
	{
	public:
		/* [CONSTRUCTOR] */	Camera();

		virtual void		setupCamera();

		void				setActive();
		
		void				setFovY( float fovY );
		void				setZPlanes( float zNear, float zFar );
		void				setEye( float x, float y, float z );
		void				setEye( Vec3<float> eye );
		void				setCenter( float x, float y, float z );
		void				setCenter( Vec3<float> center );
		void				setUp( float x, float y, float z );
		void				setUp( Vec3<float> up );

		float				getZNear();
		float				getZFar();
		Vec3<float>			getEye();
		Vec3<float>			getCenter();

		virtual EPSG::Node*	setParent( EPSG::Group* parent );
		virtual EPSG::Node*	getParent();
		EPSG::Transform*	getTransformRotate();
		EPSG::Transform*	getTransformTranslate();

		void				translate( float x, float y, float z );
		void				rotate( float angle, float x, float y, float z );
		void				rotate( float x, float y, float z );

	private:
		float				_fovY;
		float				_zNear;
		float				_zFar;
		Vec3<float>			_eye;
		Vec3<float>			_center;
		Vec3<float>			_up;

		EPSG::Transform*	_cameraTransformRotate;
		EPSG::Transform*	_cameraTransformTranslate;
	};
}

#endif //_EPSG_CAMERA_